package com.huluobo.kotlinim2006a.contract.chat

import com.huluobo.kotlinim2006a.base.BasePresenter
import com.hyphenate.chat.EMMessage

/**
 * Created by lc on 2023/2/8.
 */
class ChatContract {
    interface Presenter : BasePresenter {
        /**
         * @param contact 消息联系人
         * @param message 具体发送的消息
         */
        fun sendMessage(contact: String, message: String)
        fun addMessage(userName: String, messages: MutableList<EMMessage>?)

        //新增需求,需要添加历史消息记录,加载更多消息
        fun loadMessages(userName: String)
        fun loadMoreMessage(userName: String)
    }

    interface View {
        fun onStartSendMessage()//触发发送消息的进度条
        fun onSendMessageSuccess()//更新Recyclerview,并且展示消息
        fun onSendMessageFailed()//更新Recyclerview,并且展示红叹号,代表发送失败
        fun onMessageLoaded() //读取历史消息后需要添加到数据源当中
        fun onMoreMessagesLoaded(size: Int)
    }
}